package com.jackiechan.day15.lang;

public class MyRunnable implements java.lang.Runnable {
    public static void main(String[] args) {
        // 创建对象
        MyRunnable runnable = new MyRunnable();
        // 绑定 Thread 和目标类的关系
        Thread thread = new Thread(runnable);
        Thread thread1 = new Thread(runnable);
        Thread thread2 = new Thread(runnable);
        // 启动线程
        thread.start();

        thread1.start();
        thread2.start();
//        System.out.println(thread == thread1);
    }

    int in=0;
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            System.out.println(i+"\t"+Thread.currentThread().getName());
        }
    }
}
